package com.intranet.sys.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.water.domain.BaseDomain;
/**
 * 菜单
 * @author whl
 *
 */
@Entity
@Table(name = "water_sys_menu")
public class Menu extends BaseDomain {

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	@Column(name = "id")
	private Integer id;

	@Column(name = "parentId")
	private Integer parentId;

	@Column(name = "name")
	private String name;

	@Column(name = "url")
	private String url;
	
	@Column(name = "isOpen")
	private String isOpen;
	
	@Column(name = "status")
	private String status;
	
	/**
	 * 访问路径
	 */
	@Column(name = "accesspath")
	private String accesspath;
	
	@OneToMany(cascade = { CascadeType.ALL})
	@JoinColumn(name = "parentId")
	private Set<Menu> menus = new HashSet<Menu>(0);
	

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the parentId
	 */
	public Integer getParentId() {
		return parentId;
	}

	/**
	 * @param parentId
	 *            the parentId to set
	 */
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the url
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * @param url
	 *            the url to set
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * @return the isOpen
	 */
	public String getIsOpen() {
		return isOpen;
	}

	/**
	 * @param isOpen the isOpen to set
	 */
	public void setIsOpen(String isOpen) {
		this.isOpen = isOpen;
	}

	public Set<Menu> getMenus() {
		return menus;
	}

	public void setMenus(Set<Menu> menus) {
		this.menus = menus;
	}

	public String getAccesspath() {
		return accesspath;
	}

	public void setAccesspath(String accesspath) {
		this.accesspath = accesspath;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}





}
